home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Vollversion / CamD / development / examples / drum / large.c < prev    next >
C/C++ Source or Header  |  2000-05-15  |  2KB  |  73 lines

  1. /* ============================================================================ *
  2.                       large.c -- large code routines for drum machine
  3.                                       By Talin.
  4.                                ©1991 The Dreamers Guild
  5.  * ============================================================================ */
  6.  
  7. #include "std_headers.h"
  8.  
  9. #ifndef EXEC_TYPES_H
  10. #include <exec/types.h>
  11. #endif
  12.  
  13. #ifndef INTUITION_INTUITION_H
  14. #include <intuition/intuition.h>
  15. #endif
  16.  
  17. #ifndef DOS_DOS_H
  18. #include <dos/dos.h>
  19. #endif
  20.  
  21. #include <intuition/classes.h>
  22.  
  23. #include <midi/camd.h>
  24. #include <midi/mididefs.h>
  25. #include <libraries/realtime.h>
  26. #include <libraries/realtimebase.h>
  27.  
  28. #include <clib/camd_protos.h>
  29.  
  30. extern LONG             clocks_per_column,
  31.                         total_playback_column,
  32.                         local_playback_column,
  33.                         next_column_time;
  34.  
  35. extern WORD             clock_state;
  36. extern struct Task      *main_task;
  37.  
  38. ULONG myHookFunc (struct pmTime *msg, struct PlayerInfo *pi);
  39. #pragma regcall( myHookFunc(a1,a2) )
  40.  
  41.     /* Hook function... */
  42.  
  43. ULONG myHookFunc (struct pmTime *msg, struct PlayerInfo *pi)
  44. {   struct Conductor *cond = pi->pi_Source;
  45.  
  46.     switch (msg->pmt_Method) {
  47.     case PM_TICK:
  48.         if (msg->pmt_Time > next_column_time)
  49.         {       /* I don't like this method... We need a real method... */
  50.  
  51.             total_playback_column++;
  52.             next_column_time += clocks_per_column;
  53.             Signal(main_task,SIGBREAKF_CTRL_F);
  54.         }
  55.         break;
  56.  
  57.     case PM_STATE:
  58.         clock_state = cond->cdt_State;
  59.         Signal(main_task,SIGBREAKF_CTRL_E);
  60.         break;
  61.  
  62. #if 0
  63.     case PM_SHUTTLE:
  64.         current_time = msg->pmt_Time;
  65.         if ( (current_time ^ last_time) & ~0x3f)
  66.         {   Signal(main_task,SIGBREAKF_CTRL_F);
  67.             last_time = current_time;
  68.         }
  69. #endif
  70.     }
  71.     return 0L;
  72. }
  73.